namespace _9.建造者模式;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Pen p = new Pen(Color.Black);
        PersonThinBuilder ptb = new PersonThinBuilder(pictureBox1.CreateGraphics(), p);
        PersonDirector pdThin = new PersonDirector(ptb);
        pdThin.CreatePerson();

        //构造函数传入画板和颜色
        PersonFatBuilder pfb = new PersonFatBuilder(pictureBox2.CreateGraphics(), p);
        PersonDirector pdFat = new PersonDirector(pfb);
        pdFat.CreatePerson();
    }
}